The Haversine formula is used to calculate the great-circle distance between two points on the surface of a sphere. Because the Earth is nearly spherical, this formula is commonly applied to determine the distance between two geographic locations using latitude and longitude.
Unlike a flat-Earth (Cartesian) calculation, the Haversine formula accounts for the Earth's curvature, providing an accurate distance for long journeys—essential for applications like aviation, GPS navigation, and geospatial analysis.